#include <stdio.h>
#define STOP '#'
int main(void)
{
    char c;
    int count_space = 0;
    int count_lines = 0;
    int chars = 0;

    printf("输入字符（直到#结束）：");
    while ((c = getchar()) != STOP)
    {
        if (c == ' ')
            count_space++;
        else if (c == '\n')
            count_lines++;
        else
            chars++;
    }
    printf("空格数：%d\t换行符：%d\t其余字符数：%d\n", count_space, count_lines, chars);
    
    return 0;
}